<?php

/**
 * FootballFactory, Copyright Robin Loop & Pascal Wirz, 2014
 * ---
 * Template zum Auflisten der Saisons
 *
 * @author Robin
 */

require('templates/header.php');
?>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <!-- JQuery -->
        <script src="../js/jquery-1.8.3.min.js"></script>
        <script src="../js/jquery-ui-1.9.2.custom.min.js"></script>
        
        <!-- JS -->
        <script src="../js/admin_menu.js"></script>
        
        <!-- CSS -->
        <link href="../css/admin.css" rel="stylesheet">
        <link href="../css/smoothness/jquery-ui-1.9.2.custom.css" rel="stylesheet">
        
    </head>

    <body>
        
        <?php include 'menu.php'; ?>
        
        <div>
            <h1>Saisons</h1>
                
            <div>
                <table>
                    <tr>
                      <th>ID</th>
                      <th>Name</th>
                      <th>Saisonbeginn</th>
                      <th>Saisonende</th>
                      <th></th>
                      <th></th>
                    </tr>
                    <?php foreach ($seasons as $season) { ?>
                    <tr>
                        <td><?php echo $season->getId()?></td>
                        <td><?php echo $season->getName()?></td>
                        <td><?php echo date('d.m.Y', strtotime($season->getStartdate()))?></td>
                        <td><?php echo date('d.m.Y', strtotime($season->getEnddate()))?></td>
                        <td><a href="season.php?action=edit&amp;seasonId=<?php echo $season->getId()?>">editieren</a></td>
                        <td><!--<a href="season.php?action=delete&amp;seasonId=<?php echo $season->getId()?>" onclick="return confirm('Saison loeschen?')">loeschen</a>--></td>
                    </tr>  
                    <?php } ?>
                </table>
                <p>Anzahl Saisons: <?php echo $numbSeasons ?></p>
                <p><a href="season.php?action=new">Neue Saison erfassen</a></p>
            </div>
        </div>
    </body>
</html>